home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / AppleEvents.h < prev    next >
Text File  |  1991-04-17  |  24KB  |  622 lines

  1. /************************************************************
  2.  
  3. Created: Monday, January 28, 1991 at 5:55 PM
  4.     AppleEvents.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.         Copyright Apple Computer, Inc.    1989-1990
  9.         All rights reserved
  10.     
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __APPLEEVENTS__
  16. #define __APPLEEVENTS__
  17.  
  18. #ifndef __TYPES__
  19. #include <Types.h>
  20. #endif
  21.  
  22. #ifndef __MEMORY__
  23. #include <Memory.h>
  24. #endif
  25.  
  26. #ifndef __OSUTILS__
  27. #include <OSUtils.h>
  28. #endif
  29.  
  30. #ifndef __EVENTS__
  31. #include <Events.h>
  32. #endif
  33.  
  34. #ifndef __EPPC__
  35. #include <EPPC.h>
  36. #endif
  37.  
  38. #ifndef __NOTIFICATION__
  39. #include <Notification.h>
  40. #endif
  41.  
  42.  
  43. enum {
  44.  
  45.  
  46. #define typeBoolean 'bool'
  47. #define typeChar 'TEXT'
  48. #define typeSMInt 'shor'
  49. #define typeInteger 'long'
  50. #define typeSMFloat 'sing'
  51. #define typeFloat 'doub'
  52. #define typeLongInteger 'long'
  53. #define typeShortInteger 'shor'
  54. #define typeLongFloat 'doub'
  55. #define typeShortFloat 'sing'
  56. #define typeExtended 'exte'
  57. #define typeComp 'comp'
  58. #define typeMagnitude 'magn'
  59. #define typeAEList 'list'
  60. #define typeAERecord 'reco'
  61. #define typeTrue 'true'
  62. #define typeFalse 'fals'
  63. #define typeAlias 'alis'
  64. #define typeEnumerated 'enum'
  65. #define typeType 'type'
  66. #define typeAppParameters 'appa'
  67. #define typeProperty 'prop'
  68. #define typeFSS 'fss '
  69. #define typeKeyword 'keyw'
  70. #define typeSectionH 'sect'
  71. #define typeWildCard '****'
  72.  
  73. #define typeApplSignature 'sign'
  74. #define typeSessionID 'ssid'
  75. #define typeTargetID 'targ'
  76. #define typeProcessSerialNumber 'psn '
  77. #define typeNull 'null'                 /*the type of null/nonexistent data*/
  78.  
  79. #define kCoreEventClass 'aevt'
  80.  
  81. #define kAEOpenApplication 'oapp'
  82. #define kAEOpenDocuments 'odoc'
  83. #define kAEPrintDocuments 'pdoc'
  84. #define kAEQuitApplication 'quit'
  85.  
  86. #define kAECreatorType 'crea'
  87. #define kAEQuitAll 'quia'
  88. #define kAEShutDown 'shut'
  89. #define kAERestart 'rest'
  90. #define kAEApplicationDied 'obit'
  91. #define keyProcessSerialNumber 'psn '
  92.  
  93. #define keyErrorNumber 'errn'
  94. #define keyErrorString 'errs'
  95.  
  96. #define kAEAnswer 'ansr'
  97.  
  98. #define keyDirectObject '----'
  99.  
  100.  
  101. /* keyword used in install special handler */
  102. #define keyPreDispatch 'phac'           /* PreHandler Accessor Call */
  103. #define keySelectProc 'selh'            /* More selector Call */
  104.  
  105. /* keywords used in attributes */
  106. #define keyTransactionIDAttr 'tran'
  107. #define keyReturnIDAttr 'rtid'
  108. #define keyEventClassAttr 'evcl'
  109. #define keyEventIDAttr 'evid'
  110. #define keyAddressAttr 'addr'
  111. #define keyOptionalKeywordAttr 'optk'
  112. #define keyTimeoutAttr 'timo'
  113. #define keyInteractLevelAttr 'inte'     /*this attribute is read only will be set in AESend*/
  114. #define keyEventSourceAttr 'esrc'       /* this attribute is read only */
  115. #define keyMissedKeywordAttr 'miss'     /* this attribute is read only */
  116.  
  117. /* constants for use in AESendMode */
  118.  
  119.     kAENoReply = 0x00000001,            /* Sender doesn't want a reply to event */
  120.     kAEQueueReply = 0x00000002,         /* Sender wants a reply but won't wait */
  121.     kAEWaitReply = 0x00000003,          /* Sender wants a reply and will be waiting */
  122.  
  123.     kAENeverInteract = 0x00000010,      /* Server should not interact with user */
  124.     kAECanInteract = 0x00000020,        /* Server may try to interact with user */
  125.     kAEAlwaysInteract = 0x00000030,     /* Server should always interact with user where appropriate */
  126.  
  127.     kAECanSwitchLayer = 0x00000040,     /* Interaction may switch layer */
  128.  
  129.     kAEDontReconnect = 0x00000080,      /* don't reconnect if there is a sessClosedErr from PPCToolbox */
  130.  
  131.  
  132. #define kAEWantReceipt nReturnReceipt   /* Send wants a receipt of message */
  133.  
  134. /* constants to be used in AESendPriority */
  135.  
  136.     kAENormalPriority = 0x00000000,     /* Post message at the end of event queue */
  137.  
  138. #define kAEHighPriority nAttnMsg        /* Post message at the front of the event queue */
  139.  
  140. /* special constants in generating events */
  141.  
  142.     kAnyTransactionID = 0,              /* no transaction is in use */
  143.     kAutoGenerateReturnID = -1,         /* AECreateAppleEvent will generate a session-unique ID */
  144.  
  145. /* constant for use AESend */
  146.     kAEDefaultTimeout = -1,             /* timeout value determined by AEM */
  147.     kNoTimeOut = -2,                    /* wait until reply comes back, however long it takes */
  148.  
  149. /* dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch
  150. table, or one of these two constants */
  151.     kAENoDispatch = 0,
  152.     kAEUseStandardDispatch = -1,
  153.  
  154. /* Error messages in response to reading and writing event contents */
  155.     errAECoercionFail = -1700,
  156.     errAEDescNotFound = -1701,
  157.     errAECorruptData = -1702,
  158.     errAEWrongDataType = -1703,
  159.     errAENotAEDesc = -1704
  160. };
  161. enum {
  162.     errAEBadListItem = -1705,           /* Specified list item does not exist */
  163.     errAENewerVersion = -1706,          /* Need newer version of AppleEvent Manager */
  164.     errAENotAppleEvent = -1707,         /* The event is not in AppleEvent format */
  165.  
  166. /* Error messages in response to sending/receiving a message */
  167.     errAEEventNotHandled = -1708,       /* The AppleEvent was not handled by any handler */
  168.     errAEReplyNotValid = -1709,         /* AEResetTimer was passed an invalid reply parameter */
  169.     errAEUnknownSendMode = -1710,       /* Mode wasn't NoReply, WaitReply, or QueueReply;     or Interaction level is unknown */
  170.     errAEWaitCanceled = -1711,          /* In AESend, User cancelled out of wait loop for  reply or receipt */
  171.     errAETimeout = -1712,               /* AppleEvent timed out */
  172.  
  173.     errAENoUserInteraction = -1713,     /* no user interaction allowed */
  174.     errAENotASpecialFunction = -1714,   /* there is no special function with this keyword */
  175.     errAEParamMissed = -1715,           /* a required parameter was not accessed */
  176.  
  177.     errAEUnknownAddressType = -1716,    /* The target address type is not known */
  178.     errAEHandlerNotFound = -1717,       /* No handler in the dispatch tables fits the parameters to
  179.                                               AEGetEventHandler or AEGetCoercionHandler */
  180.  
  181.     errAEReplyNotArrived = -1718,       /* the contents of the reply you are accessing have not arrived yet */
  182.     errAEIllegalIndex = -1719           /* Index is out of range in a put operation */
  183. };
  184.  
  185. typedef unsigned long AEKeyword;
  186. typedef unsigned long AEEventClass;
  187. typedef unsigned long AEEventID;
  188. typedef ResType DescType;
  189.  
  190. /* tagged data, the standard AppleEvent data type */
  191. struct AEDesc {
  192.     DescType descriptorType;
  193.     Handle dataHandle;
  194. };
  195.  
  196. typedef struct AEDesc AEDesc;
  197.  
  198.  
  199. typedef AEDesc AEAddressDesc;           /* an AEDesc which contains addressing data */
  200. typedef AEDesc AEDescList;              /* a list of AEDesc is a special kind of AEDesc */
  201. typedef AEDescList AERecord;            /* AERecord is a list of keyworded AEDesc */
  202. typedef AERecord AppleEvent;            /* an AERecord that contains an AppleEvent */
  203. typedef long AESendMode;                /* Type of parameter to AESend */
  204. typedef short AESendPriority;           /* Type of priority param of AESend */
  205.  
  206. enum {kAEInteractWithSelf,kAEInteractWithLocal,kAEInteractWithAll};
  207. typedef unsigned char AEInteractAllowed;
  208.  
  209. enum {kAEUnknownSource,kAEDirectCall,kAESameProcess,kAELocalProcess,kAERemoteProcess};
  210. typedef unsigned char AEEventSource;
  211.  
  212.  
  213. /* types for AppleEvent Array support 
  214.  
  215.  Basic data type of attibutes & parameters*/
  216. struct AEKeyDesc {
  217.     AEKeyword descKey;
  218.     AEDesc descContent;
  219. };
  220.  
  221. typedef struct AEKeyDesc AEKeyDesc;
  222.  
  223.  
  224. enum {kAEDataArray,kAEPackedArray,kAEHandleArray,kAEDescArray,kAEKeyDescArray};
  225. typedef unsigned char AEArrayType;
  226.  
  227.  
  228. /* Array routines support these different types of elements*/
  229. union AEArrayData {
  230.     short AEDataArray[1];
  231.     char AEPackedArray[1];
  232.     Handle AEHandleArray[1];
  233.     AEDesc AEDescArray[1];
  234.     AEKeyDesc AEKeyDescArray[1];
  235. };
  236.  
  237. typedef union AEArrayData AEArrayData;
  238. typedef AEArrayData *AEArrayDataPointer;
  239.  
  240.  
  241.  
  242. typedef ProcPtr EventHandlerProcPtr;
  243. typedef ProcPtr IdleProcPtr;
  244. typedef ProcPtr EventFilterProcPtr;
  245.  
  246. #ifdef __cplusplus
  247. extern "C" {
  248. #endif
  249.  
  250. /* 
  251.       *********************************************************************
  252.     The following calls apply to any AEDesc. Every result descriptor is created for you,
  253.     so you will be responsible for memory management of the descriptors so created.
  254.     Purgeable descriptor data is not supported: the AEM does not call LoadResource.  
  255. */
  256.  
  257. pascal OSErr AECreateDesc(DescType typeCode,
  258.                           Ptr dataPtr,
  259.                           Size dataSize,
  260.                           AEDesc *result)
  261.     = {0x303C,0x0825,0xA816}; 
  262. pascal OSErr AECoercePtr(DescType typeCode,Ptr dataPtr,Size dataSize,DescType toType,
  263.     AEDesc *result)
  264.     = {0x303C,0x0A02,0xA816}; 
  265. pascal OSErr AECoerceDesc(const AEDesc *theAEDesc,
  266.                           DescType toType,
  267.                           AEDesc *result)
  268.     = {0x303C,0x0603,0xA816}; 
  269. pascal OSErr AEDisposeDesc(AEDesc *theAEDesc)
  270.     = {0x303C,0x0204,0xA816}; 
  271. pascal OSErr AEDuplicateDesc(const AEDesc *theAEDesc,AEDesc *result)
  272.     = {0x303C,0x0405,0xA816}; 
  273.  
  274. /* 
  275.     *********************************************************************
  276.      The following calls apply to AEDescList.
  277.       Since AEDescList is a subtype of AEDesc, the calls in the previous
  278.       section can also be used for AEDescList. All list and array indices are 1-based.
  279.       If the data was greater than maximumSize in the routines below, then actualSize will
  280.       be greater than maximumSize, but only maximumSize bytes will actually be retrieved.
  281. */
  282.  
  283. pascal OSErr AECreateList(Ptr factoringPtr,Size factoredSize,Boolean isRecord,
  284.     AEDescList *resultList)
  285.     = {0x303C,0x0706,0xA816}; 
  286. pascal OSErr AECountItems(const AEDescList *theAEDescList,
  287.                           long *theCount)
  288.     = {0x303C,0x0407,0xA816}; 
  289. pascal OSErr AEPutPtr(const AEDescList *theAEDescList,
  290.                       long index,
  291.                       DescType typeCode,
  292.                       Ptr dataPtr,
  293.                       Size dataSize)
  294.     = {0x303C,0x0A08,0xA816}; 
  295. pascal OSErr AEPutDesc(const AEDescList *theAEDescList,
  296.                        long index,
  297.                        const AEDesc *theAEDesc)
  298.     = {0x303C,0x0609,0xA816}; 
  299. pascal OSErr AEGetNthPtr(const AEDescList *theAEDescList,
  300.                          long index,
  301.                          DescType desiredType,
  302.                          AEKeyword *theAEKeyword,
  303.                          DescType *typeCode,
  304.                          Ptr dataPtr,
  305.                          Size maximumSize,
  306.                          Size *actualSize)
  307.     = {0x303C,0x100A,0xA816}; 
  308. pascal OSErr AEGetNthDesc(const AEDescList *theAEDescList,
  309.                           long index,
  310.                           DescType desiredType,
  311.                           AEKeyword *theAEKeyword,
  312.                           AEDesc *result)
  313.     = {0x303C,0x0A0B,0xA816}; 
  314. pascal OSErr AESizeOfNthItem(const AEDescList *theAEDescList,
  315.                              long index,
  316.                              DescType *typeCode,
  317.                              Size *dataSize)
  318.     = {0x303C,0x082A,0xA816}; 
  319. pascal OSErr AEGetArray(const AEDescList *theAEDescList,
  320.                         AEArrayType arrayType,
  321.                         AEArrayDataPointer arrayPtr,
  322.                         Size maximumSize,
  323.                         DescType *itemType,
  324.                         Size *itemSize,
  325.                         long *itemCount)
  326.     = {0x303C,0x0D0C,0xA816}; 
  327. pascal OSErr AEPutArray(const AEDescList *theAEDescList,
  328.                         AEArrayType arrayType,
  329.                         AEArrayDataPointer arrayPtr,
  330.                         DescType itemType,
  331.                         Size itemSize,
  332.                         long itemCount)
  333.     = {0x303C,0x0B0D,0xA816}; 
  334. pascal OSErr AEDeleteItem(const AEDescList *theAEDescList,
  335.                           long index)
  336.     = {0x303C,0x040E,0xA816}; 
  337.  
  338. /* 
  339.     *********************************************************************
  340.     The following calls apply to AERecord.
  341.       Since AERecord is a subtype of AEDescList, the calls in the previous
  342.       sections can also be used for AERecord
  343.       an AERecord can be created by using AECreateList with isRecord set to true 
  344. */
  345.  
  346. pascal OSErr AEPutKeyPtr(const AERecord *theAERecord,
  347.                          AEKeyword theAEKeyword,
  348.                          DescType typeCode,
  349.                          Ptr dataPtr,
  350.                          Size dataSize)
  351.     = {0x303C,0x0A0F,0xA816}; 
  352. pascal OSErr AEPutKeyDesc(const AERecord *theAERecord,
  353.                           AEKeyword theAEKeyword,
  354.                           const AEDesc *theAEDesc)
  355.     = {0x303C,0x0610,0xA816}; 
  356. pascal OSErr AEGetKeyPtr(const AERecord *theAERecord,
  357.                          AEKeyword theAEKeyword,
  358.                          DescType desiredType,
  359.                          DescType *typeCode,
  360.                          Ptr dataPtr,
  361.                          Size maximumSize,
  362.                          Size *actualSize)
  363.     = {0x303C,0x0E11,0xA816}; 
  364. pascal OSErr AEGetKeyDesc(const AERecord *theAERecord,
  365.                           AEKeyword theAEKeyword,
  366.                           DescType desiredType,
  367.                           AEDesc *result)
  368.     = {0x303C,0x0812,0xA816}; 
  369. pascal OSErr AESizeOfKeyDesc(const AERecord *theAERecord,
  370.                              AEKeyword theAEKeyword,
  371.                              DescType *typeCode,
  372.                              Size *dataSize)
  373.     = {0x303C,0x0829,0xA816}; 
  374. pascal OSErr AEDeleteKeyDesc(const AERecord *theAERecord,
  375.                              AEKeyword theAEKeyword)
  376.     = {0x303C,0x0413,0xA816}; 
  377.  
  378. /* 
  379.     
  380.         *********************************************************************
  381.         The following calls are used to pack and unpack parameters from records of
  382.         type AppleEvent. Since AppleEvent is a subtype of AERecord, the calls in the previous
  383.         sections can also be used for variables of type AppleEvent. The next six calls
  384.         are in fact identical to the six calls for AERecord.
  385. */
  386.  
  387. pascal OSErr AEPutParamPtr(const AppleEvent *theAppleEvent,
  388.                            AEKeyword theAEKeyword,
  389.                            DescType typeCode,
  390.                            Ptr dataPtr,
  391.                            Size dataSize)
  392.     = {0x303C,0x0A0F,0xA816}; 
  393. pascal OSErr AEPutParamDesc(const AppleEvent *theAppleEvent,
  394.                             AEKeyword theAEKeyword,
  395.                             const AEDesc *theAEDesc)
  396.     = {0x303C,0x0610,0xA816}; 
  397. pascal OSErr AEGetParamPtr(const AppleEvent *theAppleEvent,
  398.                            AEKeyword theAEKeyword,
  399.                            DescType desiredType,
  400.                            DescType *typeCode,
  401.                            Ptr dataPtr,
  402.                            Size maximumSize,
  403.                            Size *actualSize)
  404.     = {0x303C,0x0E11,0xA816}; 
  405. pascal OSErr AEGetParamDesc(const AppleEvent *theAppleEvent,
  406.                             AEKeyword theAEKeyword,
  407.                             DescType desiredType,
  408.                             AEDesc *result)
  409.     = {0x303C,0x0812,0xA816}; 
  410. pascal OSErr AESizeOfParam(const AppleEvent *theAppleEvent,
  411.                            AEKeyword theAEKeyword,
  412.                            DescType *typeCode,
  413.                            Size *dataSize)
  414.     = {0x303C,0x0829,0xA816}; 
  415. pascal OSErr AEDeleteParam(const AppleEvent *theAppleEvent,
  416.                            AEKeyword theAEKeyword)
  417.     = {0x303C,0x0413,0xA816}; 
  418.  
  419. /* 
  420.     *********************************************************************
  421.     The following calls also apply to type AppleEvent.  Message attributes are far more restricted, and
  422.     can only be accessed through the following 5 calls. The various list and record routines cannot be used
  423.     to access the attributes of an event. 
  424. */
  425.  
  426. pascal OSErr AEGetAttributePtr(const AppleEvent *theAppleEvent,
  427.                                AEKeyword theAEKeyword,
  428.                                DescType desiredType,
  429.                                DescType *typeCode,
  430.                                Ptr dataPtr,
  431.                                Size maximumSize,
  432.                                Size *actualSize)
  433.     = {0x303C,0x0E15,0xA816}; 
  434. pascal OSErr AEGetAttributeDesc(const AppleEvent *theAppleEvent,
  435.                                 AEKeyword theAEKeyword,
  436.                                 DescType desiredType,
  437.                                 AEDesc *result)
  438.     = {0x303C,0x0826,0xA816}; 
  439. pascal OSErr AESizeOfAttribute(const AppleEvent *theAppleEvent,
  440.                                AEKeyword theAEKeyword,
  441.                                DescType *typeCode,
  442.                                Size *dataSize)
  443.     = {0x303C,0x0828,0xA816}; 
  444. pascal OSErr AEPutAttributePtr(const AppleEvent *theAppleEvent,
  445.                                AEKeyword theAEKeyword,
  446.                                DescType typeCode,
  447.                                Ptr dataPtr,
  448.                                Size dataSize)
  449.     = {0x303C,0x0A16,0xA816}; 
  450. pascal OSErr AEPutAttributeDesc(const AppleEvent *theAppleEvent,
  451.                                 AEKeyword theAEKeyword,
  452.                                 const AEDesc *theAEDesc)
  453.     = {0x303C,0x0627,0xA816}; 
  454.  
  455. /* 
  456.     *********************************************************************
  457.      The next four calls are basic routines used to create, send, and process AppleEvents. 
  458. */
  459.  
  460. pascal OSErr AECreateAppleEvent(AEEventClass theAEEventClass,
  461.                                 AEEventID theAEEventID,
  462.                                 const AEAddressDesc *target,
  463.                                 short returnID,
  464.                                 long transactionID,
  465.                                 AppleEvent *result)
  466.     = {0x303C,0x0B14,0xA816}; 
  467. pascal OSErr AESend(const AppleEvent *theAppleEvent,
  468.                     AppleEvent *reply,
  469.                     AESendMode sendMode,
  470.                     AESendPriority sendPriority,
  471.                     long timeOutInTicks,
  472.                     IdleProcPtr idleProc,
  473.                     EventFilterProcPtr filterProc)
  474.     = {0x303C,0x0D17,0xA816}; 
  475. pascal OSErr AEProcessAppleEvent(const EventRecord *theEventRecord)
  476.     = {0x303C,0x021B,0xA816}; 
  477.  
  478. /* 
  479.     During event processing, an event handler may realize that it is likely
  480.     to exceed the client's timeout limit. Passing the reply to this
  481.     routine causes a wait event to be generated to ask the client for more time. 
  482. */
  483.  
  484. pascal OSErr AEResetTimer(const AppleEvent *reply)
  485.     = {0x303C,0x0219,0xA816}; 
  486.  
  487. /* 
  488.       *********************************************************************
  489.     The following four calls are available for applications which need more sophisticated control
  490.     over when and how events are processed. Applications which implement multi-session servers or 
  491.     which implement their own internal event queueing will probably be the major clients of these
  492.     routines.  
  493.     
  494.      Can be called from within a handler to prevent the AEM from disposing of
  495.     the AppleEvent when the handler returns. Can be used to asynchronously process the 
  496.     event (as in MacApp).
  497. */
  498.  
  499. pascal OSErr AESuspendTheCurrentEvent(const AppleEvent *theAppleEvent)
  500.     = {0x303C,0x022B,0xA816}; 
  501.  
  502. /* 
  503.     
  504.          Tells the AppleEvent manager that processing is either about to resume or has
  505.         been completed on a previously suspended event. The procPtr passed in as the
  506.         dispatcher parameter will be called to attempt to redispatch the event. Several
  507.         constants for the dispatcher parameter allow special behavior. They are:
  508.         - kAEUseStandardDispatch means redispatch as if the event was just received, using the
  509.             standard AppleEvent Dispatcher.
  510.         - kAENoDispatch means ignore the parameter.
  511.             Use this in the case where no redispatch is needed, and the event has been handled.
  512.         - non nil means call the routine which dispatcher points to.
  513. */
  514.  
  515. pascal OSErr AEResumeTheCurrentEvent(const AppleEvent *theAppleEvent,
  516.                                      const AppleEvent *reply,
  517.                                      EventHandlerProcPtr dispatcher,
  518.                                      long handlerRefcon)
  519.     = {0x303C,0x0818,0xA816}; 
  520. /* Allows application to examine the currently executing event */
  521. pascal OSErr AEGetTheCurrentEvent(AppleEvent *theAppleEvent)
  522.     = {0x303C,0x021A,0xA816}; 
  523. /* Set the current event to the parameter */
  524. pascal OSErr AESetTheCurrentEvent(const AppleEvent *theAppleEvent)
  525.     = {0x303C,0x022C,0xA816}; 
  526.  
  527. /* 
  528.     
  529.         *********************************************************************
  530.          The following three calls are used to allow applications to behave courteously 
  531.         when a user interaction such as a dialog box is needed. 
  532. */
  533.  
  534. pascal OSErr AEGetInteractionAllowed(AEInteractAllowed *level)
  535.     = {0x303C,0x021D,0xA816}; 
  536. pascal OSErr AESetInteractionAllowed(AEInteractAllowed level)
  537.     = {0x303C,0x011E,0xA816}; 
  538. pascal OSErr AEInteractWithUser(long timeOutInTicks,NMRecPtr nmReqPtr,IdleProcPtr idleProc)
  539.     = {0x303C,0x061C,0xA816}; 
  540.  
  541. /* 
  542.      *********************************************************************
  543.      These calls are used to set up and modify the event dispatch table  }
  544.      
  545.     { Add an AppleEvent Handler 
  546. */
  547.  
  548. pascal OSErr AEInstallEventHandler(AEEventClass theAEEventClass,
  549.                                    AEEventID theAEEventID,
  550.                                    EventHandlerProcPtr handler,
  551.                                    long handlerRefcon,
  552.                                    Boolean isSysHandler)
  553.     = {0x303C,0x091F,0xA816}; 
  554. /*  Remove an AppleEvent Handler  */
  555. pascal OSErr AERemoveEventHandler(AEEventClass theAEEventClass,
  556.                                   AEEventID theAEEventID,
  557.                                   EventHandlerProcPtr handler,
  558.                                   Boolean isSysHandler)
  559.     = {0x303C,0x0720,0xA816}; 
  560. /*  Get the corresponding AppleEvent Handler  */
  561. pascal OSErr AEGetEventHandler(AEEventClass theAEEventClass,
  562.                                AEEventID theAEEventID,
  563.                                EventHandlerProcPtr *handler,
  564.                                long *handlerRefcon,
  565.                                Boolean isSysHandler)
  566.     = {0x303C,0x0921,0xA816}; 
  567.  
  568. /* 
  569.      *********************************************************************
  570.      These calls are used to set up and modify the coercion dispatch table  
  571. */
  572.  
  573. pascal OSErr AEInstallCoercionHandler(DescType fromType,
  574.                                       DescType toType,
  575.                                       ProcPtr handler,
  576.                                       long handlerRefcon,
  577.                                       Boolean fromTypeIsDesc,
  578.                                       Boolean isSysHandler)
  579.     = {0x303C,0x0A22,0xA816}; 
  580. /*  Remove a Coercion Handler  */
  581. pascal OSErr AERemoveCoercionHandler(DescType fromType,
  582.                                      DescType toType,
  583.                                      ProcPtr handler,
  584.                                      Boolean isSysHandler)
  585.     = {0x303C,0x0723,0xA816}; 
  586. /*  Get the corresponding Coercion Handler  */
  587. pascal OSErr AEGetCoercionHandler(DescType fromType,
  588.                                   DescType toType,
  589.                                   ProcPtr *handler,
  590.                                   long *handlerRefcon,
  591.                                   Boolean *fromTypeIsDesc,
  592.                                   Boolean isSysHandler)
  593.     = {0x303C,0x0B24,0xA816}; 
  594.  
  595. /* 
  596.     
  597.           *********************************************************************
  598.         These calls are used to set up and modify special hooks into the AppleEvent Manager.
  599.     
  600.         Install the special handler named by the Keyword  
  601. */
  602.  
  603. pascal OSErr AEInstallSpecialHandler(AEKeyword functionClass,
  604.                                      ProcPtr handler,
  605.                                      Boolean isSysHandler)
  606.     = {0x303C,0x0500,0xA816}; 
  607. /*  Remove the special handler named by the Keyword  */
  608. pascal OSErr AERemoveSpecialHandler(AEKeyword functionClass,
  609.                                     ProcPtr handler,
  610.                                     Boolean isSysHandler)
  611.     = {0x303C,0x0501,0xA816}; 
  612. /*  Get the special handler named by the Keyword  */
  613. pascal OSErr AEGetSpecialHandler(AEKeyword functionClass,
  614.                                  ProcPtr *handler,
  615.                                  Boolean isSysHandler)
  616.     = {0x303C,0x052D,0xA816}; 
  617. #ifdef __cplusplus
  618. }
  619. #endif
  620.  
  621. #endif
  622.